package org.example.demo.controller.userController;

import org.example.demo.dto.ProductShowParam;
import org.example.demo.service.userService.UserHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping(value = "/user/home")
public class UserHomeController {
    @Autowired
    UserHomeService userHomeService;

    @RequestMapping(value = "/banner")
    @ResponseBody
    public List<ProductShowParam> genBanner(){
        return userHomeService.genBanner();
    }

    @RequestMapping(value = "/cate")
    @ResponseBody
    public List<ProductShowParam> genCate(Long cate){
        return userHomeService.genCate(cate);
    }
}
